RevertTextEncodingToScriptInfo
Converts the given Mac OS text encoding specification to the corresponding script code and, if possible, language code and font name.
pascal OSStatus RevertTextEncodingToScriptInfo ( TextEncoding iEncoding, ScriptCode *oTextScriptID, LangCode *oTextLanguageID Str255 oTextFontname);
iEncoding
- The text encoding specification to be converted.
oTextScriptID
- A pointer to a value of type
ScriptCode
. On output, a Mac OS script code that corresponds to the text encoding specification you identified in theiEncoding
parameter. If you do not pass a pointer for this parameter on input, the function returns aparamErr
result code.oTextLanguageID
- A pointer to a value of type
LangCode
. On input, to indicate that you do not want the function to return the language code, specifyNULL
as the value of this parameter. On output, the appropriate language code, if the language can be unambiguously derived from the text encoding specification, for example, Japanese, and you did not set the parameter toNULL
.- If you do not specify
NULL
on input and the language is ambiguous--that is, the function cannot accurately derive it from the text encoding specification--the function returns a value ofkTextLanguageDontCare
.oTextFontname
- A Pascal string. On input, to indicate that you do not want the function to return the font name, specify
NULL
as the value of this parameter. On output, the name of the appropriate font if the font can be unambiguously derived from the text encoding specification, for example, Symbol, and you did not set the parameter toNULL
.- If you do not specify
NULL
on input and the font is ambiguous--that is, the function cannot accurately derive it from the text encoding specification--the function returns a zero-length string.- function result
- A result code. The function returns
paramErr
if the text encoding specification input parameter value is invalid. The function returns akTECTableFormatErr
result code if the internal mapping tables used for translation are invalid. For a list of other possible result codes, see "Text Encoding Conversion Manager Result Codes" (page 43).DISCUSSION
If you have applications that use Mac OS Script Manager and Font Manager functions, you can use theRevertTextEncodingToScriptInfo
function to convert information in a text encoding specification into the appropriate Mac OS script code, language code, and font name, if they can be unambiguously derived. Your application can then use this information to display text to a user on the screen.SEE ALSO
The functionUpgradeScriptInfoToTextEncoding
(page 56)"Text Encoding Base" (page 31)